<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
		<style>
			.bluetext {
				color: blue;
			}
			.redtext {
				color: red;
			}
			.static {
				width: 100px;
				height: 50px;
				text-align: center;
				background: #ADD8E6;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<h1>通过style属性控制样式</h1>
			<div style="color: red;">Hello,World!</div>
			
			<h1>通过class属性控制样式</h1>
			<div class="bluetext">这是一段文字</div>
			
			<h1>通过Vue控制元素的class属性</h1>
			<div :class="[staticClass, redtext]">Hello,Vue!</div>
		</div>
		
		<script>
			var app = Vue.createApp({
				data(){
					return {
						staticClass: 'static',
						redtext: 'redtext'
					}
				}
			}).mount("#app")
		</script>
	</body>
</html>
